﻿using B.S.BaseData.Api.Read.Command.GoodsCommand;
using B.S.BaseData.ErrorCode;
using B.S.BataBase.Domain.DTO.GoodsDTO;
using B.S.BataBase.Domain.Entitys;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.BaseData.Api.Read.Controllers
{
    /// <summary>
    /// 溯源管理 -API  -读
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class GoodsController : ControllerBase
    {
        /// <summary>
        /// 中介者
        /// </summary>
        private readonly IMediator _mediator;
        /// <summary>
        /// 构造方法
        /// </summary>
        /// <param name="mediator">中介者</param>
        public GoodsController(IMediator mediator)
        {
            _mediator = mediator;
        }
        /// <summary>
        /// 商品信息列表显示
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<ApiPaging<GoodInfoDTO>>> GoodsShow([FromQuery] GoodsInfoShowCommand command)
        {
            return await _mediator.Send(command);
        }
        /// <summary>
        /// 商品名称下拉框显示
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpGet]
        public Task<APIResult<List<GoodsType>>> GoodTypeShow([FromQuery] GoodTypeShowCommand command)
        {
            return _mediator.Send(command);
        }
        /// <summary>
        /// 商品详细回显成功
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<GoodInfoDTO>> Goodsdetail([FromQuery] GoodsdetailCommand command)
        {
            return await _mediator.Send(command);
        }
        /// <summary>
        /// 产品检验报告图片显示
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpGet]
        public Task<APIResult<List<ImgInfo>>> GoodsproductsImgShow([FromQuery] GoodsproductsImgShowCommand command)
        {
            return _mediator.Send(command);
        }
        /// <summary>
        /// 商品养殖列表显示
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<GoodscultivationInfo>> GoodscultivationShow([FromQuery] GoodscultivationShowCommand command)
        {
            return await _mediator.Send(command);
        }
        /// <summary>
        /// 保健信息显示
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpGet]
        public Task<APIResult<List<GoodshealthInfo>>> Handle([FromQuery] GoodsHealShowCommand command)
        {
            return _mediator.Send(command);
        }
        /// <summary>
        /// 养殖企业信息显示
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<GoodscultivationCompany>> GoodscultivationCompanyShow([FromQuery] GoodscultivationCompanyCommand command)
        {
            return await _mediator.Send(command);
        }
        /// <summary>
        /// 屠宰信息显示
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<GoodsslaughterInfo>> GoodsslaughterShow([FromQuery] GoodsslaughterShowCommand command)
        {
            return await _mediator.Send(command);
        }
        /// <summary>
        /// 屠宰企业显示
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<GoodsslaughterInfoCompany>> GoodsslaughterInfoCompanyShow([FromQuery] GoodsslaughterInfoCompanyShowCommand command)
        {
            return await _mediator.Send(command);
        }
        /// <summary>
        /// 深加工信息显示
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<GoodschargeInfo>> GoodschargeShow([FromQuery] GoodschargeShowCommand command)
        {
            return await _mediator.Send(command);
        }
        /// <summary>
        /// 原料信息显示
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<GoodsvendorInfo>> GoodsvendorShow([FromQuery] GoodsvendorCommand command)
        {
            return await _mediator.Send(command);
        }
        /// <summary>
        /// 辅料信息显示
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<GoodsvendorAccessories>> GoodsvendorAccessories([FromQuery] GoodsvendorAccessoriesCommand command)
        {
            return await _mediator.Send(command);
        }
        /// <summary>
        /// 添加剂信息显示
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<Goodsvendoradditive>> Goodsvendoradditive([FromQuery] GoodsvendoradditiveCommand command)
        {
            return await _mediator.Send(command);
        }
        /// <summary>
        /// 包材信息显示
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<GoodsvendPackagingmaterials>> GoodsvendPackagingmaterials([FromQuery] GoodsvendPackagingmaterialsCommand command)
        {
            return await _mediator.Send(command);
        }
        /// <summary>
        /// 深加工公司信息显示
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<GoodsProcessingInfo>> GoodsGoodsProcessingInfo([FromQuery] GoodsGoodsProcessingInfoCommand command)
        {
            return await _mediator.Send(command);
        }
    }
}
